package com.liang.file;

import java.io.File;

public class FileText5 {
    public static void main(String[] args) {
        File file = new File("D:\\itheima");

        delete(file);
    }

    public static void delete(File file) {
        File[] files = file.listFiles();
        for (File file1 : files) {
            if (file1.isFile()) {
                file1.delete();
            }else{
                delete(file1);
            }
        }
        file.delete();
    }

    public static class DeleteDemo {
        public static void main(String[] args) {
            File file = new File("D:\\itheima\\aaa");
            File[] files = file.listFiles();


            boolean result = file.delete();
            System.out.println(result);


        }
    }
}
